package com.neuedu.corejava.ch13.homework;

public class ThreadPriority extends Thread {

	private int count = 0;
	@Override
	public void run() {
		while (count < 200) {
			if (getPriority()== 10) {
				System.out.println(getId() +": "+ "线程1正在运行"+count);
			}
			if(getPriority()==6) {
				System.out.println(getId() +": "+ "线程2正在运行"+count);
			}
			count++;
		}

	}
	public static void main(String[] args) {
		ThreadPriority tPriority = new ThreadPriority();
		tPriority.setPriority(MAX_PRIORITY);
		ThreadPriority tPriority2 = new ThreadPriority();
		tPriority2.setPriority(6);
		tPriority.start();
		tPriority2.start();
	}

}
